#include"my_list.h"
#include<string>
using namespace std;

void test1()
{
	hjq::list<int> l1;
	l1.push_back(1);
	l1.push_back(2);
	l1.push_back(3);
	l1.push_back(4);
	l1.push_front(5);
	l1.push_front(6);
	for (auto e : l1)
	{
		cout << e << " " ;
	}
	cout << endl;
	l1.pop_back();
	l1.pop_back();
	l1.pop_front();
	for (auto e : l1)
	{
		cout << e << " ";
	}
	cout << endl;
	hjq::list<int>::iterator it = l1.begin();
	++it;
	it=l1.insert(it, 9);
	for (auto e : l1)
	{
		cout << e << " ";
	}
	cout << endl;
	++it;
	l1.erase(it);
	for (auto e : l1)
	{
		cout << e << " ";
	}
	cout << endl;
}

void test2()
{
	hjq::list<int> l1;
	hjq::list<int> l2;
	l1.push_back(1);
	l1.push_back(2);
	l1.push_back(3);
	l1.push_back(4);
	l1.push_front(5);
	l1.push_front(6);
	cout << l1.front() << endl;
	cout << l1.back() << endl;
	cout << l1.size() << endl;
	cout << l1.empty() << endl;

	cout << l2.size() << endl;
	cout << l2.empty() << endl;
}

void test3()
{
	hjq::list<int> l1;
	l1.push_back(1);
	l1.push_back(2);
	l1.push_back(3);
	l1.push_back(4);
	l1.push_front(5);
	l1.push_front(6);
	hjq::list<int> l2(10,5);
	for (auto e : l2)
	{
		cout << e << " ";
	}
	cout << endl;
	hjq::list<int> l3(l2);
	for (auto e : l3)
	{
		cout << e << " ";
	}
	cout << endl;
	string s1("sdgjkj");
	hjq::list<char> l4(s1.begin(), s1.end());
	for (auto e : l4)
	{
		cout << e << " ";
	}
	cout << endl;
	l2 = l1;
	for (auto e : l2)
	{
		cout << e << " ";
	}

}

int main()
{
	test1();
	test2();
	test3();
	return 0;
}